package com.example.demo.controller;

import com.example.demo.service.AutomaticallyGenerateAppearance;
import org.dom4j.DocumentException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.xml.sax.SAXException;

import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;

/**
 * 功能描述：
 *
 * @Author: Zhanghf
 * @Date: 2021/12/18 16:42
 */
@RestController
public class AutomaticallyGenerateController {
    @Autowired
    private AutomaticallyGenerateAppearance automaticallyGenerateAppearance;
    @PostMapping("/getMaleAppearance")
            public String getMaleAppearance(@RequestParam String type) throws ParserConfigurationException, SAXException, DocumentException, IOException {
        String s = automaticallyGenerateAppearance.automaticallyGenerateMale(type);
        return s;
    }
    @PostMapping("/getFemaleAppearance")
    public String getFemaleAppearance(@RequestParam String type) throws ParserConfigurationException, SAXException, DocumentException, IOException {
        String s = automaticallyGenerateAppearance.automaticallyGenerateFemale(type);
        return s;
    }
}
